<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateItemHasContactsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('item_has_contacts', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('item_id')->default(0);
            $table->string('name', 10)->default('')->comment('联系人');
            $table->string('phone', 11)->default('')->comment('联系号码');
            $table->timestamps();
            $table->softDeletes();

            $table->index(['item_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('item_has_contacts');
    }
}
